package com.wst.util;

/**
 * @ClassName ResultUtil
 * @Description TODO
 * @Author yanyi
 * @Date 2019/6/13 10:24
 * @Version 1.0
 **/
public class ResultUtil {

    /**
     * @Author yanyi
     * @Description //TODO 成功返回类型
     * @Date 10:41 2019/6/13
     * @Param [object]
     * @return com.wst.util.Result
     **/
    public static Result success(Object object){
        Result result=new Result();
        result.setCode(200);
        result.setMsg("成功");
        result.setData(object);
        return result;
    }

    public static Result success(){
        return success(null);
    }

    
    /**
     * @Author yanyi
     * @Description //TODO
     * @Date 10:43 2019/6/13
     * @Param [code, msg]
     * @return com.wst.util.Result
     **/
    public static Result error(Integer code,String msg){
        Result result=new Result();
        result.setData(code);
        result.setMsg(msg);
        return result;
    }

}
